package me.zhengjie.modules.weixin.processor.impl;


import me.zhengjie.modules.weixin.dto.WeChatAccount;
import me.zhengjie.modules.weixin.message.AnalyzerReplyMessage;
import me.zhengjie.modules.weixin.message.reply.AbstractReplyMessage;
import me.zhengjie.modules.weixin.processor.AbstractProcessor;

public class CoreProcessor extends AbstractProcessor {

    public CoreProcessor() {

    }

    public CoreProcessor(WeChatAccount account, AnalyzerReplyMessage reply) {
        this.account = account;
        this.reply = reply;
    }

    @Override
    public AbstractReplyMessage process() {
        String replyType = reply.getReplyType();

        AbstractReplyMessage replyMsg;
        switch (replyType) {
            case "text":
                replyMsg = respText(textRespond());
                break;
            case "images":
                replyMsg = respImage(imageRespond());
                break;
            case "music":
                replyMsg = respMusic(musicRespond());
                break;
            case "news":
                replyMsg = respNews(newsRespond(true));
                break;
            case "voice":
                replyMsg = respVoice(voiceRespond());
                break;
            case "video":
                replyMsg = respVideo(videoRespond());
                break;
            default:
                replyMsg = respText(textRespond());
                break;
        }

        return replyMsg;
    }

}
